
<!-- 字段未设置编辑权限或当前用户在编辑权限内 -->
<if condition="!$formData['member_id'] || in_array($index['member_id'],explode(',',$formData['member_id']))">

<switch name="formData.form_type">

	<case value="text">

		<input type="text" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input" />

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').blur(function()
			{
				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
			})

		</script>

	</case>

	<case value="phone">

		<input type="text" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input" />

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').blur(function()
			{
				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
			})

		</script>

	</case>

	<case value="email">

		<input type="text" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input" />

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').blur(function()
			{
				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
			})

		</script>

	</case>

	<case value="number">

		<input type="number" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && event.keyCode<48 || event.keyCode>57) event.returnValue=false" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input" />

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').blur(function()
			{
				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
			})

		</script>

	</case>

	<case value="decimal">

		<input type="text" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input" />

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').blur(function()
			{
				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
			})

		</script>

	</case>

	<case value="date">

		<input type='text' name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" class="layui-input cursor layui-form-time" id="form_type_time<php>echo $ft;</php>" placeholder="{:L('SELECT_TIME')}" >

		<script>

			layui.use(['laydate'],function()
			{
				var laydate = layui.laydate;

				laydate.render({
					elem: '#form_type_time{$ft}',
					type: 'datetime',
					trigger: 'click',
					done: function(value, date)
					{
						//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',value,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
					}
				});
			})

		</script>

	</case>

	<case value="checkbox">

		<volist name="formData.option" id="op">

			 <input type="checkbox" name="{$formType}_form[{$formData.form_name}][]" value="{$op}" title="{$op}" <in name="op" value="$dataInfo['detail'][$formData[form_name]]">checked</in> lay-skin="primary" lay-filter="checkbox-filter{$t}" />

		</volist>

		<script >

			layui.use(['form'],function()
			{
				var form = layui.form;

				form.on('checkbox(checkbox-filter{$t})', function(data)
				{
					var content = [];

					$('input[name="{$formType}_form[{$formData.form_name}][]"]:checked').each(function()
					{
						content.push($(this).val());
					});

					//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}][]"]'));

				})
			})

		</script>

	</case>

	<case value="radio">

		<volist name="formData.option" id="op">

			<input type="radio" name="{$formType}_form[{$formData.form_name}]" <eq name="dataInfo['detail'][$formData[form_name]]" value="$op" >checked</eq> value="{$op}" title="{$op}" lay-filter="radio-filter{$t}">

		</volist>

		<script >

			layui.use(['form'],function()
			{
				var form = layui.form;

				form.on('radio(radio-filter{$t})', function(data)
				{
					//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',data.value,'{$formData.form_name}',$('input[name="{$formType}_form[{$formData.form_name}]"]'));
				})
			})

		</script>

	</case>

	<case value="select">

		<select name="{$formType}_form[{$formData.form_name}]" lay-filter="select-filter{$t}">

			<option value="">{$formData.form_description}</option>

			<foreach name="formData.option" item="op">

				<option value="{$op}" <eq name="dataInfo['detail'][$formData[form_name]]" value="$op" >selected</eq>>{$op}</option>

			</foreach>

		</select>

		<script>

			layui.use(['form'],function()
			{
				var form = layui.form;

				form.on('select(select-filter{$t})', function(data)
				{
					//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',data.value,'{$formData.form_name}',$('select[name="{$formType}_form[{$formData.form_name}]"]'));
				})
			})

		</script>

	</case>

	<case value="select_text">

		<!-- 下拉填写 -->
		<input type="text" name="{$formType}_form[{$formData.form_name}]" placeholder="" value="{$dataInfo['detail'][$formData['form_name']]}" readonly="readonly" class="layui-input cursor">

		<ul id="selectText{$t}" class="select-text" style="top:35px;">

			<foreach name="formData.option" item="op">

				<li data-value="{$op}" <eq name="dataInfo['detail'][$formData[form_name]]" value="$op" >class="active"</eq>>{$op}</li>

			</foreach>

		</ul>

		<script>

			$('input[name="{$formType}_form[{$formData.form_name}]"]').click(function ()
			{
				if($('#selectText{$t}').is(':hidden'))
				{
					$('#selectText{$t}').show();
				}
				else
				{
					$('#selectText{$t}').hide();
				}

				$('#selectText{$t} li').click(function ()
				{
					$('#selectText{$t} li').removeClass('active');
					var value = $(this).data('value');
					if(value == '其他')
					{
						$('input[name="{$formType}_form[{$formData.form_name}]"]').removeAttr("readonly");
						$('input[name="{$formType}_form[{$formData.form_name}]"]').val('');
						$('input[name="{$formType}_form[{$formData.form_name}]"]').focus();
					}
					else
					{
						$('input[name="{$formType}_form[{$formData.form_name}]"]').attr('readonly','readonly');
						$('input[name="{$formType}_form[{$formData.form_name}]"]').val(value);
					}
					$(this).addClass('active');
					$('#selectText{$t}').hide();
				})
			})

		</script>

	</case>

	<case value="region">

		<div class="region-input-div wd60 fl">

		<div class="layui-input-inline wd100 mb10 layui-form region-item <neq name='crmsite.regionType' value='world'>hidden</neq>" lay-filter="country">

			<select name="{$formType}_form[{$formData[form_name]}_defaultCountry]" lay-filter="select-country<php>echo $reg;</php>" id="country<php>echo $reg;</php>" lay-ignore>

				<option value="">{:L('PLEASE_SELECT')}</option>

				<volist name="country" id="vc">

					<option value="{$vc.code}" <neq name='crmsite.regionType' value='world'><eq name='vc.code' value='1'>selected</eq><else/><eq name="dataInfo[$formData[form_name]]['defaultCountry']" value='$vc.code'>selected</eq></neq>>{$vc.name}</option>

				</volist>

			</select>

		</div>

		<div class="layui-input-inline wd100 mb10 <empty name="dataInfo['detail'][$formData[form_name]]['defaultProv']"><eq name='crmsite.regionType' value='world'>hidden</eq></empty> layui-form region-item" lay-filter="province">

			<select  name="{$formType}_form[{$formData[form_name]}_defaultProv]" lay-filter="select-province<php>echo $reg;</php>" id="province<php>echo $reg;</php>" lay-ignore>

				<option value="">{:L('PLEASE_SELECT')}</option>

			</select>

		</div>

		<div class="layui-input-inline wd100 mb10 <empty name="dataInfo['detail'][$formData[form_name]]['defaultCity']">hidden</empty> layui-form region-item" lay-filter="city">

			<select  name="{$formType}_form[{$formData[form_name]}_defaultCity]" lay-filter="select-city<php>echo $reg;</php>" id="city<php>echo $reg;</php>" lay-ignore>

				<option value="">{:L('PLEASE_SELECT')}</option>


			</select>

		</div>

		<div class="layui-input-inline wd100 mb10 <empty name="dataInfo['detail'][$formData[form_name]]['defaultArea']">hidden</empty> layui-form region-item" lay-filter="area">

			<select  name="{$formType}_form[{$formData[form_name]}_defaultArea]" lay-filter="select-area<php>echo $reg;</php>" id="area<php>echo $reg;</php>" lay-ignore>

				<option value="">{:L('PLEASE_SELECT')}</option>


			</select>

		</div>

		</div>

		<i class="layui-icon layui-icon-about intro-icon fl blue8 ml10" data-note="{:L('ENTER_NAME_SEARCH')}"></i>

		<script type="text/javascript">

			<neq name='crmsite.regionType' value='world'>

				<empty name='crmsite.regionType'>

					var defaultCountry<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultCountry']}";

				<else/>

					var defaultCountry<php>echo $reg;</php> = "1";

				</empty>

			<else/>

				var defaultCountry<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultCountry']}";

			</neq>

			<empty name="dataInfo[$formData[form_name]]['defaultProv']" >

				<neq name="crmsite.regionType" value="world">

					var defaultProv<php>echo $reg;</php> = "{$province}";

				<else/>

					var defaultProv<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultProv']}";

				</neq>

			<else/>

				var defaultProv<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultProv']}";

			</empty>

			var defaultCity<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultCity']}";

			var defaultArea<php>echo $reg;</php> = "{$dataInfo[$formData[form_name]]['defaultArea']}";

			$("#country<php>echo $reg;</php>").select2();

			$("#province<php>echo $reg;</php>").select2();

			$("#city<php>echo $reg;</php>").select2();

			$("#area<php>echo $reg;</php>").select2();

			$("#country<php>echo $reg;</php>").change(function()
			{
				selectProvince('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");

				var content = $(this).val();

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$(this).parent().parent(),"{$formData['form_type']}");
			})

			$("#province<php>echo $reg;</php>").change(function()
			{
				selectCity('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");

				var country = $('select[name="{$formType}_form[{$formData.form_name}_defaultCountry]"]').val();

				var province = $(this).val();

				var content = country+','+province;

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$(this).parent().parent(),"{$formData['form_type']}");
			})

			$("#city<php>echo $reg;</php>").change(function()
			{
				selectArea('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");

				var country = $('select[name="{$formType}_form[{$formData.form_name}_defaultCountry]"]').val();

				var province = $('select[name="{$formType}_form[{$formData.form_name}_defaultProv]"]').val();

				var city = $(this).val();

				var content = country+','+province+','+city;

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$(this).parent().parent(),"{$formData['form_type']}");
			})

			$("#area<php>echo $reg;</php>").change(function()
			{
				var country = $('select[name="{$formType}_form[{$formData.form_name}_defaultCountry]"]').val();

				var province = $('select[name="{$formType}_form[{$formData.form_name}_defaultProv]"]').val();

				var city = $('select[name="{$formType}_form[{$formData.form_name}_defaultCity]"]').val();

				var area = $(this).val();

				var content = country+','+province+','+city+','+area;

				//updateFormContentAjax('{:U("AjaxRequest/updateFormContent")}','{$infoId}','{$formType}',content,'{$formData.form_name}',$(this).parent().parent(),"{$formData['form_type']}");
			})

			if(defaultCountry<php>echo $reg;</php> && defaultProv<php>echo $reg;</php>)
			{
				$.post("{:U('AjaxRequest/getRegion')}",{country_id:defaultCountry<php>echo $reg;</php>,type:'province'},function(data)
				{
					if(data.code == 0)
					{
						var option = '<option value="">{:L(\'SELECT_PROVINCE\')}</option>';

						if(data.data.length > 0)
						{
							$.each(data.data,function(k,v)
							{
								if(defaultProv<php>echo $reg;</php>==v.code)
								{
									option += "<option c-value='"+ v.country_code+"' value='"+v.code+"' selected>"+v.name+"</option>";
								}
								else
								{
									option += "<option c-value='"+ v.country_code+"' value='"+v.code+"'>"+v.name+"</option>";
								}

							});

							$('#province<php>echo $reg;</php>').html(option).parents('.region-item').slideDown('fast');

							if(defaultProv<php>echo $reg;</php> && !defaultCity<php>echo $reg;</php>)
							{
								selectCity('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
							}
						}
						else
						{
							$('#province<php>echo $reg;</php>').html(option).parents('.region-item').slideUp('fast');
						}

						$("#province<php>echo $reg;</php>").select2();


					}
				});

				//$('#city<php>echo $reg;</php>').html('<option value="">{:L(\'SELECT_CITY\')}</option>').parents('.region-item').slideUp('fast');
			}
			else
			{
				selectProvince('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
			}

			if(defaultCountry<php>echo $reg;</php> && defaultProv<php>echo $reg;</php> && defaultCity<php>echo $reg;</php>)
			{
				$.post("{:U('AjaxRequest/getRegion')}",{country_id:defaultCountry<php>echo $reg;</php>,province_id:defaultProv<php>echo $reg;</php>,type:'city'},function(data)
				{
					if(data.code == 0)
					{
						var option = '<option value="">{:L(\'SELECT_CITY\')}</option>';

						if(data.data.length > 0)
						{
							$.each(data.data,function(k,v)
							{
								if(defaultCity<php>echo $reg;</php>==v.code)
								{
									option += "<option c-value='"+ v.country_code+"' p-value='"+ v.province_code+"' value='"+v.code+"' selected>"+v.name+"</option>";
								}
								else
								{
									option += "<option c-value='"+ v.country_code+"' p-value='"+ v.province_code+"' value='"+v.code+"'>"+v.name+"</option>";
								}
							});

							$('#city<php>echo $reg;</php>').html(option).parents('.region-item').slideDown('fast');

							if(defaultCity<php>echo $reg;</php> && !defaultArea<php>echo $reg;</php>)
							{
								selectArea('<php>echo $reg;</php>',"{:U('AjaxRequest/getRegion')}");
							}
						}
						else
						{
							$('#city<php>echo $reg;</php>').html(option).parents('.region-item').slideUp('fast');
						}

						$("#city<php>echo $reg;</php>").select2();
					}
				});
			}

			if(defaultCountry<php>echo $reg;</php> && defaultProv<php>echo $reg;</php> && defaultCity<php>echo $reg;</php> && defaultArea<php>echo $reg;</php>)
			{
				$.post("{:U('AjaxRequest/getRegion')}",{country_id:defaultCountry<php>echo $reg;</php>,province_id:defaultProv<php>echo $reg;</php>,city_id:defaultCity<php>echo $reg;</php>,type:'area'},function(data)
				{
					if(data.code == 0)
					{
						var option = '<option value="">{:L(\'SELECT_AREA\')}</option>';

						if(data.data.length > 0)
						{
							$.each(data.data,function(k,v)
							{
								if(defaultArea<php>echo $reg;</php>==v.code)
								{
									option += "<option value='"+v.code+"' selected>"+v.name+"</option>";
								}
								else
								{
									option += "<option value='"+v.code+"'>"+v.name+"</option>";
								}
							});

							$('#area<php>echo $reg;</php>').html(option).parents('.region-item').slideDown('fast');
						}
						else
						{
							$('#area<php>echo $reg;</php>').html(option).parents('.region-item').slideUp('fast');
						}

						$("#area<php>echo $reg;</php>").select2();
					}
				});
			}

		</script>

	</case>

</switch>

<else/>

<span class="fl">{$dataInfo['detail'][$formData['form_name']]|default='--'}</span>

	<eq name="formData.form_type" value="region">
		<input type="hidden" name="{$formType}_form[{$formData.form_name}_defaultCountry]" value="{$dataInfo[$formData['form_name']]['defaultCountry']}" >
		<input type="hidden" name="{$formType}_form[{$formData.form_name}_defaultProv]" value="{$dataInfo[$formData['form_name']]['defaultProv']}" >
		<input type="hidden" name="{$formType}_form[{$formData.form_name}_defaultCity]" value="{$dataInfo[$formData['form_name']]['defaultCity']}" >
		<input type="hidden" name="{$formType}_form[{$formData.form_name}_defaultArea]" value="{$dataInfo[$formData['form_name']]['defaultArea']}" >

	<else/>
		<input type="hidden" name="{$formType}_form[{$formData.form_name}]" value="{$dataInfo['detail'][$formData['form_name']]}" />
	</eq>

</if>